package butines.core.game.steering;

import butines.core.game.Vehicle;
import butines.core.math.Vector2f;

public class ArrivelBehavior extends AbstractBehavior {

	private float slowingDistance = 32f;
	private Vehicle seeker;
	private Vector2f target = new Vector2f();

	private Vector2f steeringForce;
	
	public void on(Vector2f target) {
		on();
		getTarget().set(target);
	}
	
	public Vehicle getSeeker() {
		return seeker;
	}

	public void setSeeker(Vehicle seeker) {
		this.seeker = seeker;
	}

	public Vector2f getTarget() {
		return target;
	}

	public float getSlowingDistance() {
		return slowingDistance;
	}

	public void setSlowingDistance(float slowingDistance) {
		this.slowingDistance = slowingDistance;
	}

	public Vector2f getSteeringForce() {
		return steeringForce;
	}

	@Override
	public Vector2f calculate() {
		return steeringForce = arrivel(seeker, target, slowingDistance);
	}

}
